<!DOCTYPE html>
<html lang="ch-CN">
<head>
    <meta charset="UTF-8">
    <title>while的应用！！</title>
</head>
<style>
    body {
        width: 100%;
        height: 100vh;
        background-color: wheat;
        font-size: 30px;
        text-decoration: none;
    }
</style>
<body>
</body>
<script>
    // do while--先循环一次在判断
    //循环计算  年利率为5%，1000元增长到5000元 需要多少年
    let i = 0;
    let money = 1000;
    do {
        money += money * 0.05
        i++
    } while (money < 5000)
    document.write("需要：" + i + "年")
</script>
</html>